<template>
    <div class="storeInfo">
        <div class="head">    
            <p class="headTxt" style="color:red;font-weight:900">VIP-{{params.title}}:充值记录</p>            
            <el-form class="headForm">
                <el-button type="danger" @click="back" >返回</el-button> 
            </el-form>  
        </div> 
        <!-- table -->
        <div class="tabContainer">
            <el-table :data="tableData" stripe style="width: 100%;text-align:center">
                <!-- 时间	支付金额	赠品	账户余额	记录剩余	支付方式	充值门店 -->
                <el-table-column prop="create_time" label="时间" fixed></el-table-column>
                <el-table-column prop="order_price" label="支付金额"> </el-table-column>
                <el-table-column prop="largess" label="赠品" width="200"></el-table-column>
                <el-table-column prop="balance_price" label="账户余额"></el-table-column>
                <el-table-column prop="total_balance_price" label="记录剩余"></el-table-column>               
                <el-table-column prop="pay_from_cn" label="支付方式"></el-table-column>               
                <el-table-column prop="title" label="充值门店"></el-table-column>               
                

            </el-table>                       
        </div>
        <!-- 分页部分 -->
        <el-pagination
            background
            layout="total, prev, pager, next, jumper"
            @current-change="changePage"
            :page-size="size"
            :current-page.sync="pageNum"
            :hide-on-single-page=true
            :total="total">{{total}}
        </el-pagination>
    </div>
  
</template>
<script>
import Vue from 'vue';
import { abc } from "../../../../js/abc.js";
import {potUrl} from '../../../../js/config_url.js'; 
export default {
  data () {
    return {
        tableData:[],
        total:50,
        size:20,
        pageNum:1,
        params:{
            page:1,
            size:20,
        }
    }
  },
   mounted(){
        let that = this;
        console.log(that.$route.params)
        if(that.$route.params.card_id == undefined){
            that.back()
        }
        that.params.card_id = that.$route.params.card_id
        that.params.title = that.$route.params.title;
        
        that.getList()
  },
  methods:{
    back(){
        this.$router.push('/customer')
    },
    changePage(val){
        let that = this;
        that.pageNum = val;
        that.form.page = that.pageNum;
        that.getList()
    },
    getList(){
        let that = this;
        abc.get(that,potUrl.viporderlist,{card_id:that.params.card_id},(res)=>{
            console.log(that.detailData)
            let obj = res.data.list;
            that.tableData = obj
            that.total = res.data.total;
        })//列表
    }
  }
}
</script>
